import React,{useEffect,useState} from 'react';
import axios from 'axios';
 function NodeTest() {
 
const [data,setData]=useState({});
const qingqiu = () => {
   
    axios({
        url: 'api/aaa',//不用引入，直接在api后面接接口
        method: 'get',
        data: {}
    }).then(res => {
        console.log(res)
        setData(res.data)
    }).catch(err => {
        console.log(err)
    })
   
}

    useEffect(() => {
     qingqiu()
    }, [1]);
    return (
        <div>
           {data.aaa}
        </div>
    )
}
export default NodeTest